<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<style>
			.mui-bar-tab .mui-tab-item.mui-active {
				color: #e02e24;
			}
		</style>
	</head>

	<body>
		<nav class="mui-bar mui-bar-tab">
			<a class="mui-tab-item mui-active" data-url="main.html">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</a>
			<a class="mui-tab-item" data-url="chart.html">
				<span class="mui-icon mui-icon-chatboxes">
					<span class="mui-badge mui-btn-red">99+</span>
				</span>
				
				<span class="mui-tab-label">聊天</span>
			</a>
			<a class="mui-tab-item" data-url="grzs.html">
				<span class="mui-icon mui-icon-gear"></span>
				<span class="mui-tab-label">个人中心</span>
			</a>
		</nav>

		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function() {
				var self = plus.webview.currentWebview()
				var page = [
					'main.html',
					'chart.html',
					'grzs.html',
				]
				var subStyle = {
					top: '0',
					bottom: '50px'
				}
				page.forEach(e => {
					var sub = plus.webview.create(e, e, subStyle)
					sub.hide()
					self.append(sub)
				})
				plus.webview.show(page[0])

				mui('.mui-bar-tab').on('tap', '.mui-tab-item', function() {
					var url = this.getAttribute('data-url')
					var index = page.findIndex(value => value == url)
					plus.webview.hide(page[index])
					plus.webview.show(url)
				})
			})
		</script>
	</body>

</html>